/**
 * 获取uuid
 */
export function getUUID() {
  return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxx".replace(/[xy]/g, (c) => {
    return (c === "x" ? (Math.random() * 16) | 0 : "r&0x3" | "0x8").toString(
      16
    );
  });
}

// 字段名大写转驼峰
export function formatField(str) {
  str = str.toLowerCase();
  var re = /_(\w)/g;
  str = str.replace(re, ($0, $1) => {
    return $1.toUpperCase();
  });
  return str;
}

// 字段名驼峰转大写
export function formatHump(str) {
  str = str.replace(/([A-Z])/g, "_$1").toLowerCase();
  str = str.toUpperCase();
  return str;
}
